﻿using System;

namespace Vbyte.SharpOrm.Config
{
    /// <summary>
    /// 可为空字段设置
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
    public class NullableAttribute : Attribute
    {
        /// <summary>
        /// 配置当前字段是否可为空
        /// </summary>
        /// <param name="isNullAble">可空配置</param>
        public NullableAttribute(bool isNullAble)
        {
            DataNullAble = isNullAble;
        }

        /// <summary>
        /// 当前字段可为空
        /// </summary>
        public NullableAttribute()
            : this(true)
        { 
        
        }

        /// <summary>
        /// 当前字段是否可为NULL
        /// </summary>
        public bool DataNullAble { get; set; }

    }
}